/****************************************************************************************************
		
		Replication code for:

		Jason Lyall, "Divided Armies: Inequality and Battlefield Performance in Modern War" 
		Princeton University Press, 2020  
		Last updated: 11 February 2020 
		
****************************************************************************************************/

		*Table of Contents
		
		*Main analysis: "ProjectMarsV1.dta"
		*Summary statistics:  .csv
		*Figure Folder (.png)
	
**************************************************************************************************** 


/*To run the do-file you need to install the following:

*1. To generate substantive effects (or consult http://gking.harvard.edu for alternative ways of installing Clarify)
net from http://gking.harvard.edu/clarify/
net install clarify
*2. To conduct the Coarsened Exact Matching (CEM): 
net from https://www.mattblackwell.org/files/stata
net install cem

****************************************************************************************************/

clear
use "ProjectMarsV1.dta"

****************************************************************************************************/

* Base Model: Military Inequality Coefficient Alone for All DVs

reg log_lermean mic_mean if yrstart<1918, cluster(ccode)
reg log_lermean mic_mean if yrstart>1917, cluster(ccode)
logit belowparity mic_mean if yrstart<1918, cluster(ccode)
logit belowparity mic_mean if yrstart>1917, cluster(ccode)
logit desert mic_mean if yrstart<1918, cluster(ccode)
logit desert mic_mean if yrstart>1917, cluster(ccode)
logit defect mic_mean if yrstart<1918, cluster(ccode)
logit defect mic_mean if yrstart>1917, cluster(ccode)
logit blocking mic_mean if yrstart<1918, cluster(ccode)
logit blocking mic_mean if yrstart>1917, cluster(ccode)
reg index mic_mean if yrstart<1918, cluster(ccode)
reg index mic_mean if yrstart>1917, cluster(ccode)
reg bpi mic_mean if yrstart<1918, cluster(ccode)
reg bpi mic_mean if yrstart>1917, cluster(ccode)

****************************************************************************************************

* Base Model: Military Inequality Bands Alone for All DVs

reg log_lermean mic_bands if yrstart<1918, cluster(ccode)
reg log_lermean mic_bands if yrstart>1917, cluster(ccode)
logit belowparity mic_bands if yrstart<1918, cluster(ccode)
logit belowparity mic_bands if yrstart>1917, cluster(ccode)
logit desert mic_bands if yrstart<1918, cluster(ccode)
logit desert mic_bands if yrstart>1917, cluster(ccode)
logit defect mic_bands if yrstart<1918, cluster(ccode)
logit defect mic_bands if yrstart>1917, cluster(ccode)
logit blocking mic_bands if yrstart<1918, cluster(ccode)
logit blocking mic_bands if yrstart>1917, cluster(ccode)
reg index mic_bands if yrstart<1918, cluster(ccode)
reg index mic_bands if yrstart>1917, cluster(ccode)
reg bpi  mic_bands if yrstart<1918, cluster(ccode)
reg bpi mic_bands if yrstart>1917, cluster(ccode)

****************************************************************************************************

* Reduced Form Model: Military Inequality Coefficient for All DVs


reg log_lermean mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart<1918, cluster(ccode)
reg log_lermean mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  if yrstart>1917, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  if yrstart<1918, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart>1917, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  if yrstart<1918, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart>1917, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart<1918, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart>1917, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart<1918, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart>1917, cluster(ccode)
reg index mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart<1918, cluster(ccode)
reg index mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  if yrstart>1917, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart<1918, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  if yrstart>1917, cluster(ccode)


****************************************************************************************************

* Reduced Form Model: Military Inequality Bands for All DVs


reg log_lermean mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart<1918, cluster(ccode)
reg log_lermean mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  if yrstart>1917, cluster(ccode)
logit belowparity mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  if yrstart<1918, cluster(ccode)
logit belowparity mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart>1917, cluster(ccode)
logit desert mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  if yrstart<1918, cluster(ccode)
logit desert mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart>1917, cluster(ccode)
logit defect mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart<1918, cluster(ccode)
logit defect mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart>1917, cluster(ccode)
logit blocking mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart<1918, cluster(ccode)
logit blocking mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart>1917, cluster(ccode)
reg index mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart<1918, cluster(ccode)
reg index mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  if yrstart>1917, cluster(ccode)
reg bpi mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart<1918, cluster(ccode)
reg bpi mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  if yrstart>1917, cluster(ccode)

****************************************************************************************************

* Full Model: Military Inequality Coefficient for All DVs


reg log_lermean mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
reg log_lermean mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart>1917, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
reg index mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
reg index mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   if yrstart>1917, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   if yrstart>1917, cluster(ccode)

****************************************************************************************************

* Full Model: Military Inequality Bands for All DVs


reg log_lermean mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
reg log_lermean mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit belowparity mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit belowparity mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit desert mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit desert mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit defect mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit defect mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart>1917, cluster(ccode)
logit blocking mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
logit blocking mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
reg index mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
reg index mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   if yrstart>1917, cluster(ccode)
reg bpi mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
reg bpi mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   if yrstart>1917, cluster(ccode)

****************************************************************************************************


*Generate predicted values for below parity, desertion, defection, blocking, and bpi (by era)  

logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
predict pbelowparity1800 if e(sample)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
predict pbelowparity1918 if e(sample)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
predict pdesertion1800 if e(sample)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
predict pdesertion1918 if e(sample)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
predict pdefection1800 if e(sample)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
predict pdefection1918 if e(sample)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
predict pblocking1800 if e(sample)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
predict pblocking1918 if e(sample)
reg index mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
predict pindex1800 if e(sample)
reg index mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
predict pindex1918 if e(sample)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
predict pbpi1800 if e(sample)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
predict pbpi1918 if e(sample)


****************************************************************************************************

*Generate predicted values, full sample 


logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
predict pbelowparity if e(sample)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
predict pdesertion if e(sample)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
predict pdefection if e(sample)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
predict pblocking  if e(sample)
reg index mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
predict pindex if e(sample)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
predict pbpi  if e(sample)
 
**************************************************************************************************** 
 
 
* First differences 

estsimp logit belowparity mic_bandsreduced pol2 pol2init oppdemo7 init allypowermean gp logdist standing fullvolunteer composite civilwar   warbirth ncowcombatant multiparty if yrstart<1918, cluster(ccode)
setx mic_bandsreduced (median) pol2 (median) pol2init (median) oppdemo7 (median) init (median)   allypowermean (mean) gp (median) logdist (mean) standing (median) fullvolunteer (median) multiparty (median) composite (median)    warbirth (median) ncowcombatant (median) 
simqi, fd(prval(0 1)) changex(mic_bandsreduced 0 2)
simqi, fd(prval(0 1)) changex(mic_bandsreduced 0 1)
simqi, fd(prval(0 1)) changex(mic_bandsreduced 1 2)

drop  b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16  

estsimp logit belowparity mic_bandsreduced pol2 pol2init oppdemo7 init allypowermean gp logdist standing fullvolunteer composite civilwar   warbirth ncowcombatant multiparty if yrstart>1917, cluster(ccode)
setx mic_bandsreduced (median) pol2 (median) pol2init (median) oppdemo7 (median) init (median)   allypowermean (mean) gp (median) logdist (mean) standing (median) fullvolunteer (median) multiparty (median) composite (median)    warbirth (median) ncowcombatant (median) 
simqi, fd(prval(0 1)) changex(mic_bandsreduced 0 2)
simqi, fd(prval(0 1)) changex(mic_bandsreduced 0 1)
simqi, fd(prval(0 1)) changex(mic_bandsreduced 1 2)

drop  b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 

estsimp logit desert mic_bandsreduced pol2 pol2init oppdemo7 init allypowermean gp logdist standing fullvolunteer composite civilwar   warbirth ncowcombatant multiparty if yrstart<1918, cluster(ccode)
setx mic_bandsreduced (median) pol2 (median) pol2init (median) oppdemo7 (median) init (median)   allypowermean (mean) gp (median) logdist (mean) standing (median) fullvolunteer (median) multiparty (median) composite (median)    warbirth (median) ncowcombatant (median) 
simqi, fd(prval(0 1)) changex(mic_bandsreduced 0 2)
simqi, fd(prval(0 1)) changex(mic_bandsreduced 0 1)
simqi, fd(prval(0 1)) changex(mic_bandsreduced 1 2)

drop  b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16  

estsimp logit desert mic_bandsreduced pol2 pol2init oppdemo7 init allypowermean gp logdist standing fullvolunteer composite civilwar   warbirth ncowcombatant multiparty if yrstart>1917, cluster(ccode)
setx mic_bandsreduced (median) pol2 (median) pol2init (median) oppdemo7 (median) init (median)   allypowermean (mean) gp (median) logdist (mean) standing (median) fullvolunteer (median) multiparty (median) composite (median)    warbirth (median) ncowcombatant (median) 
simqi, fd(prval(0 1)) changex(mic_bandsreduced 0 2)
simqi, fd(prval(0 1)) changex(mic_bandsreduced 0 1)
simqi, fd(prval(0 1)) changex(mic_bandsreduced 1 2)

drop  b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 


estsimp logit defect mic_bandsreduced pol2 pol2init oppdemo7 init allypowermean gp logdist standing fullvolunteer composite civilwar   warbirth ncowcombatant multiparty if yrstart<1918, cluster(ccode)
setx mic_bandsreduced (median) pol2 (median) pol2init (median) oppdemo7 (median) init (median)   allypowermean (mean) gp (median) logdist (mean) standing (median) fullvolunteer (median) multiparty (median) composite (median)    warbirth (median) ncowcombatant (median) 
simqi, fd(prval(0 1)) changex(mic_bandsreduced 0 2)
simqi, fd(prval(0 1)) changex(mic_bandsreduced 0 1)
simqi, fd(prval(0 1)) changex(mic_bandsreduced 1 2)

drop  b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16  

estsimp logit defect mic_bandsreduced pol2 pol2init oppdemo7 init allypowermean gp logdist standing fullvolunteer composite civilwar   warbirth ncowcombatant multiparty if yrstart>1917, cluster(ccode)
setx mic_bandsreduced (median) pol2 (median) pol2init (median) oppdemo7 (median) init (median)   allypowermean (mean) gp (median) logdist (mean) standing (median) fullvolunteer (median) multiparty (median) composite (median)    warbirth (median) ncowcombatant (median) 
simqi, fd(prval(0 1)) changex(mic_bandsreduced 0 2)
simqi, fd(prval(0 1)) changex(mic_bandsreduced 0 1)
simqi, fd(prval(0 1)) changex(mic_bandsreduced 1 2)

drop  b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16  


estsimp logit blocking mic_bandsreduced pol2 pol2init oppdemo7 init allypowermean gp logdist standing fullvolunteer composite civilwar   warbirth ncowcombatant multiparty if yrstart<1918, cluster(ccode)
setx mic_bandsreduced (median) pol2 (median) pol2init (median) oppdemo7 (median) init (median)   allypowermean (mean) gp (median) logdist (mean) standing (median) fullvolunteer (median) multiparty (median) composite (median)    warbirth (median) ncowcombatant (median) 
simqi, fd(prval(0 1)) changex(mic_bandsreduced 0 2)
simqi, fd(prval(0 1)) changex(mic_bandsreduced 0 1)
simqi, fd(prval(0 1)) changex(mic_bandsreduced 1 2)

drop  b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16   

estsimp logit blocking mic_bandsreduced pol2 pol2init oppdemo7 init allypowermean gp logdist standing fullvolunteer composite civilwar   warbirth ncowcombatant multiparty if yrstart>1917, cluster(ccode)
setx mic_bandsreduced (median) pol2 (median) pol2init (median) oppdemo7 (median) init (median)   allypowermean (mean) gp (median) logdist (mean) standing (median) fullvolunteer (median) multiparty (median) composite (median)    warbirth (median) ncowcombatant (median) 
simqi, fd(prval(0 1)) changex(mic_bandsreduced 0 2)
simqi, fd(prval(0 1)) changex(mic_bandsreduced 0 1)
simqi, fd(prval(0 1)) changex(mic_bandsreduced 1 2)

drop  b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16  

estsimp regress bpi mic_bandsreduced pol2 pol2init oppdemo7 init allypowermean gp logdist standing fullvolunteer composite civilwar   warbirth ncowcombatant multiparty if yrstart<1918, cluster(ccode)
setx mic_bandsreduced (median) pol2 (median) pol2init (median) oppdemo7 (median) init (median)   allypowermean (mean) gp (median) logdist (mean) standing (median) fullvolunteer (median) multiparty (median) composite (median)    warbirth (median) ncowcombatant (median) 
simqi, fd(ev) changex(mic_bandsreduced 0 2)
simqi, fd(ev) changex(mic_bandsreduced 0 1)
simqi, fd(ev) changex(mic_bandsreduced 1 2)

drop  b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17  

estsimp regress bpi mic_bandsreduced pol2 pol2init oppdemo7 init allypowermean gp logdist standing fullvolunteer composite civilwar   warbirth ncowcombatant multiparty if yrstart>1917, cluster(ccode)
setx mic_bandsreduced (median) pol2 (median) pol2init (median) oppdemo7 (median) init (median)   allypowermean (mean) gp (median) logdist (mean) standing (median) fullvolunteer (median) multiparty (median) composite (median)    warbirth (median) ncowcombatant (median) 
simqi, fd(ev) changex(mic_bandsreduced 0 2)
simqi, fd(ev) changex(mic_bandsreduced 0 1)
simqi, fd(ev) changex(mic_bandsreduced 1 2)

drop  b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 

estsimp regress index mic_bandsreduced pol2 pol2init oppdemo7 init allypowermean gp logdist standing fullvolunteer composite civilwar   warbirth ncowcombatant multiparty if yrstart<1918, cluster(ccode)
setx mic_bandsreduced (median) pol2 (median) pol2init (median) oppdemo7 (median) init (median)   allypowermean (mean) gp (median) logdist (mean) standing (median) fullvolunteer (median) multiparty (median) composite (median)    warbirth (median) ncowcombatant (median) 
simqi, fd(ev) changex(mic_bandsreduced 0 2)
simqi, fd(ev) changex(mic_bandsreduced 0 1)
simqi, fd(ev) changex(mic_bandsreduced 1 2)

drop  b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17  

estsimp regress index mic_bandsreduced pol2 pol2init oppdemo7 init allypowermean gp logdist standing fullvolunteer composite civilwar   warbirth ncowcombatant multiparty if yrstart>1917, cluster(ccode)
setx mic_bandsreduced (median) pol2 (median) pol2init (median) oppdemo7 (median) init (median)   allypowermean (mean) gp (median) logdist (mean) standing (median) fullvolunteer (median) multiparty (median) composite (median)    warbirth (median) ncowcombatant (median) 
simqi, fd(ev) changex(mic_bandsreduced 0 2)
simqi, fd(ev) changex(mic_bandsreduced 0 1)
simqi, fd(ev) changex(mic_bandsreduced 1 2)

drop  b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16  


estsimp logit bpi50 mic_bandsreduced pol2 pol2init oppdemo7 init allypowermean gp logdist standing fullvolunteer composite civilwar   warbirth ncowcombatant multiparty if yrstart<1918, cluster(ccode)
setx mic_bandsreduced (median) pol2 (median) pol2init (median) oppdemo7 (median) init (median)   allypowermean (mean) gp (median) logdist (mean) standing (median) fullvolunteer (median) multiparty (median) composite (median)    warbirth (median) ncowcombatant (median) 
simqi, fd(pr) changex(mic_bandsreduced 0 2)
simqi, fd(pr) changex(mic_bandsreduced 0 1)
simqi, fd(pr) changex(mic_bandsreduced 1 2)


drop  b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16  

estsimp logit bpi50 mic_bandsreduced pol2 pol2init oppdemo7 init allypowermean gp logdist standing fullvolunteer composite civilwar   warbirth ncowcombatant multiparty if yrstart>1917, cluster(ccode)
setx mic_bandsreduced (median) pol2 (median) pol2init (median) oppdemo7 (median) init (median)   allypowermean (mean) gp (median) logdist (mean) standing (median) fullvolunteer (median) multiparty (median) composite (median)    warbirth (median) ncowcombatant (median) 
simqi, fd(pr) changex(mic_bandsreduced 0 2)
simqi, fd(pr) changex(mic_bandsreduced 0 1)
simqi, fd(pr) changex(mic_bandsreduced 1 2)



****************************************************************************************************

*Coarsened Exact Matching (CEM) 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat1!=., tr(treat1) 
logit desert treat1 if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit desert treat1 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit desert treat1 if yrstart>1917 [iweight=cem_weights], cluster(ccode)
logit desert treat1 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
drop  cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat1!=., tr(treat1) 
logit defect treat1 if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit defect treat1 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit defect treat1 if yrstart>1917 [iweight=cem_weights], cluster(ccode)
logit defect treat1 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
drop  cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat1!=., tr(treat1) 
logit blocking treat1 if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit blocking treat1 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit blocking treat1 if yrstart>1917 [iweight=cem_weights], cluster(ccode)
logit blocking treat1 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
drop  cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat1!=., tr(treat1) 
logit belowparity treat1 if yrstart<1918 [iweight=cem_weights] 
logit belowparity treat1 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights] 
logit belowparity treat1 if yrstart>1917 [iweight=cem_weights] 
logit belowparity treat1 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights] 
drop  cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat1!=., tr(treat1) 
reg index treat1 if yrstart<1918 [iweight=cem_weights] 
reg index treat1 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights] 
reg index treat1 if yrstart>1917 [iweight=cem_weights] 
reg index treat1 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights] 
drop  cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat1!=., tr(treat1) 
reg bpi treat1 if yrstart<1918 [iweight=cem_weights] 
reg bpi treat1 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights] 
reg bpi treat1 if yrstart>1917 [iweight=cem_weights] 
reg bpi treat1 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights] 
drop cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat2!=., tr(treat2) 
logit desert treat2 if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit desert treat2 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit desert treat2 if yrstart>1917 [iweight=cem_weights], cluster(ccode)
logit desert treat2 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
drop  cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat2!=., tr(treat2) 
logit defect treat2 if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit defect treat2 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit defect treat2 if yrstart>1917 [iweight=cem_weights], cluster(ccode)
logit defect treat2 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
drop  cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat2!=., tr(treat2) 
logit blocking treat2 if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit blocking treat2 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit blocking treat2 if yrstart>1917 [iweight=cem_weights], cluster(ccode)
logit blocking treat2 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
drop  cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat2!=., tr(treat2) 
logit belowparity treat2 if yrstart<1918 [iweight=cem_weights] 
logit belowparity treat2 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights] 
logit belowparity treat2 if yrstart>1917 [iweight=cem_weights] 
logit belowparity treat2 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights] 
drop  cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat2!=., tr(treat2) 
reg index treat2 if yrstart<1918 [iweight=cem_weights] 
reg index treat2 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights] 
reg index treat2 if yrstart>1917 [iweight=cem_weights] 
reg index treat2 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights] 
drop  cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat2!=., tr(treat2) 
reg bpi treat2 if yrstart<1918 [iweight=cem_weights] 
reg bpi treat2 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights] 
reg bpi treat2 if yrstart>1917 [iweight=cem_weights] 
reg bpi treat2 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights] 
drop cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat3!=., tr(treat3) 
logit desert treat3 if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit desert treat3 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit desert treat3 if yrstart>1917 [iweight=cem_weights], cluster(ccode)
logit desert treat3 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
drop  cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat3!=., tr(treat3) 
logit defect treat3 if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit defect treat3 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit defect treat3 if yrstart>1917 [iweight=cem_weights], cluster(ccode)
logit defect treat3 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
drop  cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat3!=., tr(treat3) 
logit blocking treat3 if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit blocking treat3 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
logit blocking treat3 if yrstart>1917 [iweight=cem_weights], cluster(ccode)
logit blocking treat3 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
drop  cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat3!=., tr(treat3) 
logit belowparity treat3 if yrstart<1918 [iweight=cem_weights] 
logit belowparity treat3 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights] 
logit belowparity treat3 if yrstart>1917 [iweight=cem_weights] 
logit belowparity treat3 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights] 
drop  cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat3!=., tr(treat3) 
reg index treat3 if yrstart<1918 [iweight=cem_weights] 
reg index treat3 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights] 
reg index treat3 if yrstart>1917 [iweight=cem_weights] 
reg index treat3 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights] 
drop  cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat3!=., tr(treat3) 
reg bpi treat3 if yrstart<1918 [iweight=cem_weights] 
reg bpi treat3 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights] 
reg bpi treat3 if yrstart>1917 [iweight=cem_weights] 
reg bpi treat3 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights] 
drop cem_strata cem_matched cem_weights 

****************************************************************************************************

*Average Marginal Effects for CEM 2-Control Group Comparison, where Group1 is Low and Group2 is Medium Band of Military Inequality  

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat1!=., tr(treat1) 
logit belowparity treat1 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
logit belowparity treat1 demo7 init demo7init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
drop cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) demo7init oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat2!=., tr(treat2) 
logit belowparity treat2 demo7 init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
logit belowparity treat2 demo7 init oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
drop cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1)  oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat1!=., tr(treat1) 
logit desert treat1 demo7 init  oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
logit desert treat1 demo7 init  oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
drop cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1)  oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat2!=., tr(treat2) 
logit desert treat2 demo7 init  oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
logit desert treat2 demo7 init  oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
drop cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1) oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat1!=., tr(treat1) 
logit defect treat1 demo7 init  oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
logit defect treat1 demo7 init  oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
drop cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1)  oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat2!=., tr(treat2) 
logit defect treat2 demo7 init  oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
logit defect treat2 demo7 init  oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
drop cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1)  oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat1!=., tr(treat1) 
logit blocking treat1 demo7 init  oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
logit blocking treat1 demo7 init  oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
drop cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1)  oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat2!=., tr(treat2) 
logit blocking treat2 demo7 init  oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
logit blocking treat2 demo7 init  oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
drop cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1)  oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat1!=., tr(treat1) 
reg bpi treat1 demo7 init  oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
reg bpi treat1 demo7 init  oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
drop cem_strata cem_matched cem_weights 

cem demo7 (0 1) init (0 1)  oppdemo7 (0 1)  allypowermean (.1 .25 .50 .75 .90) gp (0 1) joiner (0 1)  logdist standing (0 1)  fullvolunteer (0 1)  composite (0 1)  civilwar (0 1)  multiparty (0 1) warbirth (0 1)  ncowcombatant (0 1) if treat2!=., tr(treat2) 
reg bpi treat2 demo7 init  oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
reg bpi treat2 demo7 init  oppdemo7 allypowermean gp joiner logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917 [iweight=cem_weights], cluster(ccode)
margins, dydx(*) 
drop cem_strata cem_matched cem_weights 

****************************************************************************************************


*Placebo for Military Inequality Coefficient 

reg log_lermean micplacebo if yrstart<1918, cluster(ccode)
reg log_lermean  micplacebo if yrstart>1917, cluster(ccode)
logit belowparity micplacebo if yrstart<1918, cluster(ccode)
logit belowparity micplacebo if yrstart>1917, cluster(ccode)
logit desert micplacebo if yrstart<1918, cluster(ccode)
logit desert micplacebo if yrstart>1917, cluster(ccode)
logit defect micplacebo if yrstart<1918, cluster(ccode)
logit defect micplacebo if yrstart>1917, cluster(ccode)
logit blocking micplacebo if yrstart<1918, cluster(ccode)
logit blocking micplacebo if yrstart>1917, cluster(ccode)
reg index micplacebo if yrstart<1918, cluster(ccode)
reg index micplacebo if yrstart>1917, cluster(ccode)
reg bpi micplacebo if yrstart<1918, cluster(ccode)
reg bpi micplacebo if yrstart>1917, cluster(ccode)

reg log_lermean micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart<1918, cluster(ccode)
reg log_lermean micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  if yrstart>1917, cluster(ccode)
logit belowparity micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  if yrstart<1918, cluster(ccode)
logit belowparity micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart>1917, cluster(ccode)
logit desert micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  if yrstart<1918, cluster(ccode)
logit desert micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart>1917, cluster(ccode)
logit defect micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart<1918, cluster(ccode)
logit defect micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart>1917, cluster(ccode)
logit blocking micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart<1918, cluster(ccode)
logit blocking micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart>1917, cluster(ccode)
reg index micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart<1918, cluster(ccode)
reg index micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  if yrstart>1917, cluster(ccode)
reg bpi micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite if yrstart<1918, cluster(ccode)
reg bpi micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  if yrstart>1917, cluster(ccode)

reg log_lermean micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
reg log_lermean micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit belowparity micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit belowparity micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit desert micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit desert micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit defect micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit defect micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart>1917, cluster(ccode)
logit blocking micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
logit blocking micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
reg index micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
reg index micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   if yrstart>1917, cluster(ccode)
reg bpi micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
reg bpi micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   if yrstart>1917, cluster(ccode)



 
logit belowparity micplacebo if yrstart<1918, cluster(ccode)
logit belowparity micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit belowparity micplacebo if yrstart>1917, cluster(ccode)
logit belowparity micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit desert micplacebo if yrstart<1918, cluster(ccode)
logit desert micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit desert micplacebo if yrstart>1917, cluster(ccode)
logit desert micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit defect micplacebo if yrstart<1918, cluster(ccode)
logit defect micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit defect micplacebo if yrstart>1917, cluster(ccode)
logit defect micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart>1917, cluster(ccode)
logit blocking micplacebo if yrstart<1918, cluster(ccode)
logit blocking micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
logit blocking micplacebo if yrstart>1917, cluster(ccode)
logit blocking micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode) 
reg bpi micplacebo if yrstart<1918, cluster(ccode)
reg bpi micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
reg bpi micplacebo if yrstart>1917, cluster(ccode)
reg bpi micplacebo pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   if yrstart>1917, cluster(ccode)



****************************************************************************************************

 
* Robustness checks 

****************************************************************************************************



*Decade FE (1810 as referrent)

reg log_lermean mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant dum1800 dum1820 dum1830 dum1840 dum1850 dum1860 dum1870 dum1880 dum1890 dum1900 dum1910 dum1918 dum1920 dum1930 dum1940 dum1950 dum1960 dum1970 dum1980 dum1990 dum2000, cluster(ccode)
reg log_lermean mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant dum1800 dum1820 dum1830 dum1840 dum1850 dum1860 dum1870 dum1880 dum1890 dum1900 dum1910 dum1918 dum1920 dum1930 dum1940 dum1950 dum1960 dum1970 dum1980 dum1990 dum2000, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant dum1800 dum1820 dum1830 dum1840 dum1850 dum1860 dum1870 dum1880 dum1890 dum1900 dum1910 dum1918 dum1920 dum1930 dum1940 dum1950 dum1960 dum1970 dum1980 dum1990 dum2000, cluster(ccode)
logit belowparity mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant dum1800 dum1820 dum1830 dum1840 dum1850 dum1860 dum1870 dum1880 dum1890 dum1900 dum1910 dum1918 dum1920 dum1930 dum1940 dum1950 dum1960 dum1970 dum1980 dum1990 dum2000, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant dum1800 dum1820 dum1830 dum1840 dum1850 dum1860 dum1870 dum1880 dum1890 dum1900 dum1910 dum1918 dum1920 dum1930 dum1940 dum1950 dum1960 dum1970 dum1980 dum1990 dum2000, cluster(ccode)
logit desert mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant dum1800 dum1820 dum1830 dum1840 dum1850 dum1860 dum1870 dum1880 dum1890 dum1900 dum1910 dum1918 dum1920 dum1930 dum1940 dum1950 dum1960 dum1970 dum1980 dum1990 dum2000, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth dum1800 dum1820 dum1830 dum1840 dum1850 dum1860 dum1870 dum1880 dum1890 dum1900 dum1910 dum1918 dum1920 dum1930 dum1940 dum1950 dum1960 dum1970 dum1980 dum1990 dum2000, cluster(ccode)
logit defect mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant dum1800 dum1820 dum1830 dum1840 dum1850 dum1860 dum1870 dum1880 dum1890 dum1900 dum1910 dum1918 dum1920 dum1930 dum1940 dum1950 dum1960 dum1970 dum1980 dum1990 dum2000, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant dum1800 dum1820 dum1830 dum1840 dum1850 dum1860 dum1870 dum1880 dum1890 dum1900 dum1910 dum1918 dum1920 dum1930 dum1940 dum1950 dum1960 dum1970 dum1980 dum1990 dum2000, cluster(ccode)
logit blocking mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  civilwar multiparty warbirth ncowcombatant dum1800 dum1820 dum1830 dum1840 dum1850 dum1860 dum1870 dum1880 dum1890 dum1900 dum1910 dum1918 dum1920 dum1930 dum1940 dum1950 dum1960 dum1970 dum1980 dum1990 dum2000, cluster(ccode)
reg index mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant dum1800 dum1820 dum1830 dum1840 dum1850 dum1860 dum1870 dum1880 dum1890 dum1900 dum1910 dum1918 dum1920 dum1930 dum1940 dum1950 dum1960 dum1970 dum1980 dum1990 dum2000, cluster(ccode)
reg index mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant dum1800 dum1820 dum1830 dum1840 dum1850 dum1860 dum1870 dum1880 dum1890 dum1900 dum1910 dum1918 dum1920 dum1930 dum1940 dum1950 dum1960 dum1970 dum1980 dum1990 dum2000, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant dum1800 dum1820 dum1830 dum1840 dum1850 dum1860 dum1870 dum1880 dum1890 dum1900 dum1910 dum1918 dum1920 dum1930 dum1940 dum1950 dum1960 dum1970 dum1980 dum1990 dum2000, cluster(ccode)
reg bpi mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant dum1800 dum1820 dum1830 dum1840 dum1850 dum1860 dum1870 dum1880 dum1890 dum1900 dum1910 dum1918 dum1920 dum1930 dum1940 dum1950 dum1960 dum1970 dum1980 dum1990 dum2000, cluster(ccode)


****************************************************************************************************

*Region FE (Western Europe as referrent)

reg log_lermean mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant eeurop lamerica ssafrica asia nafrme namerica, cluster(ccode)
reg log_lermean mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant eeurop lamerica ssafrica asia nafrme namerica, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant eeurop lamerica ssafrica asia nafrme namerica, cluster(ccode)
logit belowparity mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant eeurop lamerica ssafrica asia nafrme namerica, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant eeurop lamerica ssafrica asia nafrme namerica, cluster(ccode)
logit desert mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant eeurop lamerica ssafrica asia nafrme namerica, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth eeurop lamerica ssafrica asia nafrme namerica, cluster(ccode)
logit defect mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant eeurop lamerica ssafrica asia nafrme namerica, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant eeurop lamerica ssafrica asia nafrme namerica, cluster(ccode)
logit blocking mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  civilwar multiparty warbirth ncowcombatant eeurop lamerica ssafrica asia nafrme namerica, cluster(ccode)
reg index mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant eeurop lamerica ssafrica asia nafrme namerica, cluster(ccode)
reg index mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant eeurop lamerica ssafrica asia nafrme namerica, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant eeurop lamerica ssafrica asia nafrme namerica, cluster(ccode)
reg bpi mic_bands pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant eeurop lamerica ssafrica asia nafrme namerica, cluster(ccode)

****************************************************************************************************


*COW Belligerents Only 

logit belowparity mic_mean if yrstart<1918 & ncowcombatant!=1, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth if yrstart<1918 & ncowcombatant!=1, cluster(ccode)
logit desert mic_mean if yrstart<1918  & ncowcombatant!=1, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth   if yrstart<1918  & ncowcombatant!=1, cluster(ccode)
logit defect mic_mean if yrstart<1918 & ncowcombatant!=1, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth   if yrstart<1918 & ncowcombatant!=1, cluster(ccode)
logit blocking mic_mean if yrstart<1918  & ncowcombatant!=1, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth    if yrstart<1918  & ncowcombatant!=1, cluster(ccode)
reg bpi mic_mean if yrstart<1918  & ncowcombatant!=1, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth    if yrstart<1918  & ncowcombatant!=1, cluster(ccode)
logit belowparity mic_mean if yrstart>1917  & ncowcombatant!=1, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth if yrstart>1917  & ncowcombatant!=1, cluster(ccode)
logit desert mic_mean if yrstart>1917   & ncowcombatant!=1, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth   if yrstart>1917   & ncowcombatant!=1, cluster(ccode)
logit defect mic_mean if yrstart>1917  & ncowcombatant!=1, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth   if yrstart>1917  & ncowcombatant!=1, cluster(ccode)
logit blocking mic_mean if yrstart>1917   & ncowcombatant!=1, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth    if yrstart>1917   & ncowcombatant!=1, cluster(ccode)
reg bpi mic_mean if yrstart>1917   & ncowcombatant!=1, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth    if yrstart>1917   & ncowcombatant!=1, cluster(ccode)


****************************************************************************************************

*Only COW Wars

logit belowparity mic_mean if yrstart<1918 & ncow4war!=1, cluster(ccode) 
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar  multiparty    if yrstart<1918 & ncow4war!=1, cluster(ccode)
logit desert mic_mean if  yrstart<1918  &  ncow4war!=1, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar  multiparty   if  yrstart<1918  &  ncow4war!=1, cluster(ccode)
logit defect mic_mean if yrstart<1918 &  ncow4war!=1, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar  multiparty      if yrstart<1918 &  ncow4war!=1, cluster(ccode)
logit blocking mic_mean if yrstart<1918  &  ncow4war!=1, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  civilwar multiparty      if yrstart<1918  &  ncow4war!=1, cluster(ccode)
reg bpi mic_mean if yrstart<1918  &  ncow4war!=1, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty      if yrstart<1918  &  ncow4war!=1, cluster(ccode)
logit belowparity mic_mean if yrstart>1917  &  ncow4war!=1, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing   fullvolunteer composite civilwar  multiparty    if yrstart>1917  &  ncow4war!=1, cluster(ccode)
logit desert mic_mean if yrstart>1917  &  ncow4war!=1, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing  fullvolunteer composite civilwar multiparty if yrstart>1917  &  ncow4war!=1, cluster(ccode)
logit defect mic_mean  if yrstart>1917  &  ncow4war!=1, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar   multiparty if yrstart>1917  &  ncow4war!=1, cluster(ccode)
logit blocking mic_mean if yrstart>1917  &  ncow4war!=1, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing  fullvolunteer composite civilwar  multiparty      if yrstart>1917  &  ncow4war!=1, cluster(ccode)
reg bpi mic_mean if yrstart>1917 &  ncow4war!=1, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar  multiparty    if yrstart>1917 &  ncow4war!=1, cluster(ccode)


****************************************************************************************************


*Dummies for leading powers


logit belowparity mic_mean tur ukg frn usa rus ger if yrstart<1918, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant tur ukg frn usa rus ger if yrstart<1918, cluster(ccode)
logit desert mic_mean tur ukg frn usa rus ger if yrstart<1918, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant tur ukg frn usa rus ger if yrstart<1918, cluster(ccode)
logit defect mic_mean  tur ukg frn usa rus ger if yrstart<1918, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant tur ukg frn usa rus ger if yrstart<1918, cluster(ccode)
logit blocking mic_mean  tur ukg frn usa rus ger  if yrstart<1918, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant tur ukg frn usa rus ger  if yrstart<1918, cluster(ccode)
reg bpi mic_mean tur ukg frn usa rus ger  if yrstart<1918, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant tur ukg frn usa rus ger  if yrstart<1918, cluster(ccode)




logit belowparity mic_mean  tur ukg frn usa rus ger if yrstart>1917, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant tur ukg frn usa rus ger if yrstart>1917, cluster(ccode)
logit desert mic_mean tur ukg frn usa rus ger if yrstart>1917, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant tur ukg frn usa rus ger if yrstart>1917, cluster(ccode)
logit defect mic_mean tur ukg frn usa rus ger if yrstart>1917, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant tur ukg frn usa rus ger if yrstart>1917, cluster(ccode)
logit blocking mic_mean tur ukg frn usa rus ger if yrstart>1917, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  civilwar multiparty warbirth ncowcombatant tur ukg frn usa rus ger if yrstart>1917, cluster(ccode)
reg bpi mic_mean  tur ukg frn usa rus ger  if yrstart>1917, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant tur ukg frn usa rus ger  if yrstart>1917, cluster(ccode)


****************************************************************************************************

  
*Alternative measure for democracy (Demo7) 


 
logit belowparity mic_mean demo7 demo7init init if yrstart<1918, cluster(ccode)
logit belowparity mic_mean demo7 demo7init init oppdemo7 joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit desert mic_mean demo7 demo7init init if yrstart<1918, cluster(ccode)
logit desert mic_mean demo7 demo7init init oppdemo7  joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit defect mic_mean demo7 demo7init init  if yrstart<1918, cluster(ccode)
logit defect mic_mean demo7 demo7init  init oppdemo7 joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit blocking mic_mean demo7 demo7init init   if yrstart<1918, cluster(ccode)
logit blocking mic_mean demo7 demo7init   init oppdemo7  joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
reg bpi mic_mean demo7 demo7init init  if yrstart<1918, cluster(ccode)
reg bpi mic_mean demo7 demo7init   init oppdemo7  joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)




logit belowparity mic_mean demo7 demo7init init if yrstart>1917, cluster(ccode)
logit belowparity mic_mean demo7 demo7init init oppdemo7 joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit desert mic_mean demo7 demo7init init if yrstart>1917, cluster(ccode)
logit desert mic_mean demo7 demo7init init oppdemo7   joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit defect mic_mean demo7 demo7init init   if yrstart>1917, cluster(ccode)
logit defect mic_mean demo7 demo7init   init  oppdemo7 joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart>1917, cluster(ccode)
logit blocking mic_mean demo7 demo7init init if yrstart>1917, cluster(ccode)
logit blocking mic_mean demo7 demo7init   init oppdemo7  joiner allypowermean gp logdist standing fullvolunteer composite  civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
reg bpi mic_mean demo7 demo7init init if yrstart>1917, cluster(ccode)
reg bpi mic_mean demo7 demo7init  init oppdemo7  joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   if yrstart>1917, cluster(ccode)

****************************************************************************************************

*Civil war subset


logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite multiparty warbirth ncowcombatant if civilwar==1, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite multiparty warbirth ncowcombatant if civilwar==1, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite multiparty warbirth ncowcombatant  if civilwar==1, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite multiparty warbirth ncowcombatant if civilwar==1, cluster(ccode)
reg index mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite multiparty warbirth ncowcombatant  if civilwar==1, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite multiparty warbirth ncowcombatant  if civilwar==1, cluster(ccode)


logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite multiparty warbirth ncowcombatant if civilwar==0, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite multiparty warbirth ncowcombatant if civilwar==0, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite multiparty warbirth ncowcombatant  if civilwar==0, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite multiparty warbirth ncowcombatant if civilwar==0, cluster(ccode)
reg index mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite multiparty warbirth ncowcombatant  if civilwar==0, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite multiparty warbirth ncowcombatant  if civilwar==0, cluster(ccode)

****************************************************************************************************



*Dummy for key wars (Napoleonic Wars, WWI, WWII)


reg log_lermean mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant napwar ww1 if yrstart<1918, cluster(ccode)
reg log_lermean mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  ww1 ww2  if yrstart>1917, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant napwar ww1   if yrstart<1918, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   ww1 ww2  if yrstart>1917, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant napwar ww1   if yrstart<1918, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   ww1 ww2  if yrstart>1917, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant napwar ww1    if yrstart<1918, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   ww1 ww2   if yrstart>1917, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant napwar ww1    if yrstart<1918, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  civilwar multiparty warbirth ncowcombatant ww1 ww2  if yrstart>1917, cluster(ccode)
reg index mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant napwar ww1    if yrstart<1918, cluster(ccode)
reg index mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   ww1 ww2   if yrstart>1917, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant napwar ww1    if yrstart<1918, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   ww1 ww2  if yrstart>1917, cluster(ccode)

****************************************************************************************************



*Reestimating with dummies for key wars, robust standard errors clustered on individual campaigns, and pooled time frame (1800-2011) 

logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant napwar ww1 ww2, cluster(campcode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant napwar ww1  ww2, cluster(campcode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant napwar ww1  ww2, cluster(campcode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant napwar ww1  ww2, cluster(campcode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant napwar ww1 ww2, cluster(campcode)

**************************************************************************************************** 


*No War Birth states (pooled) 

logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant if warbirth~=1, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant if  warbirth~=1, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant if  warbirth~=1, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant  if  warbirth~=1, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant  if  warbirth~=1, cluster(ccode)


*No War Birth states (by historical era) 

logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant if yrstart<1918 & warbirth~=1, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant if yrstart>1917 & warbirth~=1, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant if yrstart<1918 & warbirth~=1, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty  ncowcombatant if yrstart>1917 & warbirth~=1, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant if yrstart<1918 & warbirth~=1, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant  if yrstart>1917 & warbirth~=1, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant  if yrstart<1918 & warbirth~=1, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  civilwar multiparty  ncowcombatant if yrstart>1917 & warbirth~=1, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant  if yrstart<1918 & warbirth~=1, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty ncowcombatant   if yrstart>1917 & warbirth~=1, cluster(ccode)







****************************************************************************************************

* Only War Birth  

logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant if   warbirth==1, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant if   warbirth==1, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant if  warbirth==1, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty  ncowcombatant if  warbirth==1, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant if   warbirth==1, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant  if  warbirth==1, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant  if   warbirth==1, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite  civilwar multiparty  ncowcombatant if  warbirth==1, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant  if   warbirth==1, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty ncowcombatant   if   warbirth==1, cluster(ccode)

****************************************************************************************************


* Excluding High-Capital Wars  

logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty ncowcombatant if   highcap!=1, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty ncowcombatant if  highcap!=1, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty ncowcombatant if   highcap!=1, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty ncowcombatant  if   highcap!=1, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty   ncowcombatant  if   highcap!=1, cluster(ccode)


****************************************************************************************************

* Alternative Measure for Power (Relative total deployed over entire war by belligerent/coalition: Post-treatment)  

reg log_lermean mic_mean pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
reg log_lermean mic_mean pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart>1917, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite  civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
reg index mic_mean pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
reg index mic_mean pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   if yrstart>1917, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   if yrstart>1917, cluster(ccode)

reg log_lermean mic_bands pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
reg log_lermean mic_bands pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit belowparity mic_bands pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit belowparity mic_bands pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit desert mic_bands pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit desert mic_bands pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
logit defect mic_bands pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
logit defect mic_bands pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart>1917, cluster(ccode)
logit blocking mic_bands pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
logit blocking mic_bands pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite  civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)
reg index mic_bands pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
reg index mic_bands pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   if yrstart>1917, cluster(ccode)
reg bpi mic_bands pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant  if yrstart<1918, cluster(ccode)
reg bpi mic_bands pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant   if yrstart>1917, cluster(ccode)

****************************************************************************************************


* LER as logged actual values rather than a binary below parity variable  

reg log_lermean mic_mean if yrstart<1918, cluster(ccode)
reg log_lermean mic_mean pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart<1918, cluster(ccode)
reg log_lermean mic_mean if yrstart>1917, cluster(ccode)
reg log_lermean mic_mean pol2 pol2init oppdemo7 init joiner allypower2mean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if yrstart>1917, cluster(ccode)

****************************************************************************************************

*  Ethnic Diversity of Armies (Without MIC), Pooled Time Period 
 
logit belowparity logngroups pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
logit desert logngroups  pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
logit defect logngroups pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
logit blocking logngroups pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
reg bpi logngroups pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)

****************************************************************************************************

*  Ethnic Diversity of Armies (With MIC), Pooled Time Period 

 
logit belowparity logngroups mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
logit desert logngroups mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
logit defect logngroups mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
logit blocking logngroups mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
reg bpi logngroups mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)


******************************************************************************************************

* Quality Control for Military Inequality Coefficient, MIC_QC Variable, Pooled Time Period

logit belowparity mic_mean mic_qc pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
logit desert mic_mean mic_qc pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
logit defect mic_mean mic_qc pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
logit blocking mic_mean mic_qc pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
reg bpi mic_mean mic_qc pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)

* Quality Control for Military Inequality Coefficient, Dropping All MIC_QC=1 Cases, Pooled Time Period 

logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if mic_qc>1, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if mic_qc>1, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if mic_qc>1, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if mic_qc>1, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if mic_qc>1, cluster(ccode)

* Quality Control for Military Inequality Coefficient, Including Only Cases Where MIC_QC>2, Pooled Time Period 

logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if mic_qc>2, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if mic_qc>2, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if mic_qc>2, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if mic_qc>2, cluster(ccode)
reg bpi mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if mic_qc>2, cluster(ccode)


* Quality Control for Various Battlefield Performance Measures with MIC_QC Variable, Pooled Time Period

logit belowparity mic_mean mic_qc belowparity_qc pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
logit desert mic_mean mic_qc desert_qc pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
logit defect mic_mean mic_qc defect_qc pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
logit blocking mic_mean mic_qc blocking_qc pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant, cluster(ccode)
 
* Quality Control for Different Dependent Variables, Including Only Cases Where QC>2, Pooled Time Period 

logit belowparity mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if belowparity_qc>2, cluster(ccode)
logit desert mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if desert_qc>2, cluster(ccode)
logit defect mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if defect_qc>2, cluster(ccode)
logit blocking mic_mean pol2 pol2init oppdemo7 init joiner allypowermean gp logdist standing fullvolunteer composite civilwar multiparty warbirth ncowcombatant if blocking_qc>2, cluster(ccode)











